#ifndef _C_PATH_H_
#define _C_PATH_H_

#include "types/types.h"

#define MAX_PATH_CHARS			260
#define PATH_BUFFER_SIZE		MAX_PATH_CHARS + 4/*hash padding*/

class CPath
{
public:
	CPath() : m_uiNb(0) {}
	CPath(const xchar* sStr)
	{
		*this = sStr;
	}

	void operator= (const xchar* sStr);
	bool operator== (uint32 uiHash) const
	{
		return m_uiHash == uiHash;
	}
	bool operator== (const CPath& oPath) const
	{
		return m_uiHash == oPath.m_uiHash;
	}

	const xchar*	c_str() const { return m_sStr; }
	uint32			getHash() const { return m_uiHash; }

private:
	void	computeHash	();
	void	normalize	();

	xchar	m_sStr[PATH_BUFFER_SIZE];
	uint32	m_uiNb;
	uint32	m_uiHash;
};

#endif
